#!/bin/sh

cd `cat project_name`
if [ -f last_building ]; then
    BUILDROOT=`cat last_building`
else
    echo "Failed: there is no last_building"
    exit 1
fi

function clean_build_root()
{
    dir=$1
    umount $dir/proc
    rm -rf $dir
}

if [ -d $BUILDROOT ]; then
    clean_build_root $BUILDROOT
fi
